from redis import StrictRedis
class Config():
    DEBUG = None
    # 配置密钥
    SECRET_KEY = 'v4VxzNlHhYJn1rew3upZMm92nE2c3rA7RBH86w=='
    # 配置数据库连接
    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@localhost/info_python37'
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    # 抽取redis的主机和端口
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379
    # 配置ｓｅｓｓｉｏｎ状态保持信息的存储
    SESSION_TYPE= 'redis'
    SESSION_REDIS= StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
    SESSION_USE＿SIGNER= True
    # 使用ｆｌａｓｋ内置的配置信息，指定ｓｅｓｓｉｏｎ的有效期
    PERMANENT_SESSION_LIFETIME= 86400
    # 定义开发环境的配置类
class DevelopmentConfig(Config):
    DEBUG = True
class ProductionConfig(Config):
    DEBUG = False
config_dict = {
    'development':DevelopmentConfig,
    'production':ProductionConfig
}


